package com.junmoo.www.auth.module.system.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.junmoo.www.entity.SysRole;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface SysRoleMapper extends BaseMapper<SysRole> {
    @Select("<script>"
            + "select r.* from sys_role r,sys_user_role  ur where r.role_id =ur.role_id and ur.user_id =#{userId}"
            + "</script>")
    @Results(id="resultMap",value = {
            @Result(column = "role_id",property ="id",id = true )
    })
    public List<SysRole> findByUserId(@Param("userId") Long userId);
}
